// https://umijs.org/config/
import { defineConfig } from 'umi';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
const { REACT_APP_ENV } = process.env;
export default defineConfig({
  hash: true,
  antd: {
    dark: true,
  },
  dva: {
    hmr: true,
  },
  locale: {
    // default zh-CN
    default: 'en-US',
    // default true, when it is true, will use `navigator.language` overwrite default
    antd: true,
    baseNavigator: true,
  },
  dynamicImport: {
    loading: '@/components/PageLoading/index',
  },
  targets: {
    ie: 11,
  },
  // umi routes: https://umijs.org/docs/routing
routes: [
        {
          path: '/user',
          component: '../layouts/UserLayout',
          routes: [
            {
              name: 'login',
              icon: 'smile',
              path: '/user/login',
              component: './user/login',
            },
            {
              name: 'register-result',
              icon: 'smile',
              path: '/user/register-result',
              component: './user/register-result',
            },
            {
              name: 'register',
              icon: 'smile',
              path: '/user/register',
              component: './user/register',
            },
            {
              component: '404',
            },
          ],
        },
        {
		    path: '/',
			component: '../layouts/SecurityLayout',
			routes: [
			{
				  path: '/',
				  component: '../layouts/BasicLayout',
				  Routes: ['src/pages/Authorized'],
				  authority: ['admin', 'user'],
				  routes: [
					{
						path: '/dashboard',
						name: 'Dashboard',
						icon: 'dashboard',
						routes: [{
							name: 'Overview',
							icon: 'smile',
							path: '/dashboard/overview',
							component: './dashboard/overview',
						}, ],
					},
					{
						path: "/brocade",
						name: "Brocade",
						icon: "AppstoreOutlined",
						routes: [{
								name: "Dashboard",
								icon: "smile",
								path: "/brocade/dashboard",
								component: "./brocade/dashboard"
							},
							{
								name: "Configuration",
								icon: "smile",
								path: "/brocade/configuration",
								component: "./brocade/configuration"
							},
							{
								name: "Detail",
								icon: "smile",
								path: "/brocade/detail",
								component: "./brocade/detail"
							},

						]
					},
					{
						path: "/unity",
						name: "Unity",
						icon: "AppstoreOutlined",
						routes: [{
								name: "Dashboard",
								icon: "smile",
								path: "/unity/dashboard",
								component: "./unity/dashboard"
							},
							{
								name: "Configuration",
								icon: "smile",
								path: "/unity/configuration",
								component: "./unity/configuration"
							},
							{
								name: "Detail",
								icon: "smile",
								path: "/unity/detail",
								component: "./unity/detail"
							},

						]
					},
					{
						path: "/powermax",
						name: "PowerMax",
						icon: "AppstoreOutlined",
						routes: [{
								name: "Dashboard",
								icon: "smile",
								path: "/powermax/dashboard",
								component: "./powermax/dashboard"
							},
							{
								name: "Configuration",
								icon: "smile",
								path: "/powermax/configuration",
								component: "./powermax/configuration"
							},
							{
								name: "Detail",
								icon: "smile",
								path: "/powermax/detail",
								component: "./powermax/detail"
							},

						]
					},
                                        {
                                                path: "/isilon",
                                                name: "Isilon",
                                                icon: "AppstoreOutlined",
                                                routes: [{
                                                                name: "Dashboard",
                                                                icon: "smile",
                                                                path: "/isilon/dashboard",
                                                                component: "./isilon/dashboard"
                                                        },
                                                        {
                                                                name: "Configuration",
                                                                icon: "smile",
                                                                path: "/isilon/configuration",
                                                                component: "./isilon/configuration"
                                                        },
                                                        {
                                                                name: "Detail",
                                                                icon: "smile",
                                                                path: "/isilon/detail",
                                                                component: "./isilon/detail"
                                                        },

                                                ]
                                        },
                                        {
                                                path: "/ecs",
                                                name: "ECS",
                                                icon: "AppstoreOutlined",
                                                routes: [{
                                                                name: "Dashboard",
                                                                icon: "smile",
                                                                path: "/ecs/dashboard",
                                                                component: "./ecs/dashboard"
                                                        },
                                                        {
                                                                name: "Configuration",
                                                                icon: "smile",
                                                                path: "/ecs/configuration",
                                                                component: "./ecs/configuration"
                                                        },
                                                        {
                                                                name: "Detail",
                                                                icon: "smile",
                                                                path: "/ecs/detail",
                                                                component: "./ecs/detail"
                                                        },

                                                ]
                                        },

					{
					  component: '404',
					},
				  ],
				},
			]
		}
      ],
  // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  theme: {
    // ...darkTheme,
    'primary-color': defaultSettings.primaryColor,
  },
  // @ts-ignore
  title: false,
  ignoreMomentLocale: true,
  proxy: proxy[REACT_APP_ENV || 'dev'],
  manifest: {
    basePath: '/',
  },
});

